public class TextBook implements Book{

    double price;
    @Override
    public void getPrice(int page, float discount) {
        price = page * 0.07 * discount;
    }

    @Override
    public void showPrice() {
        System.out.println("教科书，价格为：" + price);
    }


    public static void main(String[] args) {

        //多态
        Book book = new ScienceBook();
        book.getPrice(350, 0.8f);
        book.showPrice();

        book = new LiteratureBook();
        book.getPrice(350, 0.8f);
        book.showPrice();

        book = new TextBook();
        book.getPrice(350, 0.8f);
        book.showPrice();

    }
}
